package com.ruoyi.stream.framework.model.configBuilder;

import com.ruoyi.stream.framework.enums.IOTaskConfigBuilderEnum;

import java.lang.reflect.InvocationTargetException;

public class IOTaskConfigBuilderFactory{

    public static <T> T getBuilder(IOTaskConfigBuilderEnum type){
        try {
            return (T) type.getBuilderConstructor().newInstance();
        } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
}
